Service-based Dynamic Repeater

Dynamic Dashboards can leverage templates to display similar items in the same dashboard, such as a list of icons or multiple grids. You can also trigger this from a Dynamic Dashboard Service Assembly file, which enables you to dynamically generate the list of items. For information on the standard no-code Repeater functionality, see Embedded Dynamic Repeater Dashboard.

USE CASE

Use an Embedded Dynamic Repeater Dashboard to Display User Images and Names

Role Benefits
Developer: Writes custom code and sets properties. Users can set up an Embedded Dynamic Repeater Dashboard and add multiple instances of the same components without having to re-create each component individually.

You want to display user images and names in a Dashboard. Complete the following steps:

  1. Create an image component and a label component. See Component Display Format Properties. In this use case, each component is configured with template parameter values variables. These are populated by the RepeatArgs in the code. When the template runs, it is replaced with the actual image URL or name.

    The image component Url Or Full File Name property with template varible is boxed with yellow highlight.

    The label component Formatting Text property with template varible entered is boxed with yellow highlight.

  2. Create an Embedded Dashboard. See Dashboard Properties. In the Dashboard Components tab, add the image and label components to the Embedded Dashboard.

    The Dashboard Type property has Embedded selected and is outline with yellow highlight

    Image and Label components added to Dashboard Components and boxed with yellow highlight

  3. Create an Embedded Dynamic Repeater Dashboard. See Embedded Dynamic Repeater Dashboard. In the Dashboard Components tab, add the Embedded Dashboard Component. When the Embedded Dynamic Repeater Dashboard runs, it will repeat this Embedded Dashboard Component for each user. 0_Frame dashboard contains the Embedded Dashboard Components for 1_Title and 2_Content dashboards.

    The Dashboard Properties tab is open and the Dashboard Type is set to Embedded Dynamic Repeater which is boxed with yellow highlight

    Embedded Dashboard component is added in the Dashboard Components tab and boxed with yellow highlight

  4. In this use case, the Maintenance Unit's Workspace Assembly Service property is set to ITAssembly.MyServiceFactory. This property matches the ITAssembly Assembly which contains the MyServiceFactory Assembly file. This assembly will return the services.

    Maintenance Unit's Workspace Assembly Service property entry boxed with yellow highlight

    The Workspace Assembly Service property matches the ITAssemblyFile and Service Factory name

  5. In the MyServiceFactory Assembly file, the following code is the request you need to enable the processing of Dynamic Dashboards. This code returns what is set in the MyDynamicDashboardService file in the same Assembly.

    Code to enable processing of Dynamic Dashboards highlighted

     MyDynamicDashboardService Assembly file is highlighted

  6. The MyDynamicDashboardService Assembly file's default source code contains various automatically created methods. Fill in the sections required to display the user images and user names.

    The logic starts with GetEmbeddedDynamicDashboard. Use this to retrieve the list of users and set them in a data structure to keep track of the user images and user names.

    The logic starts with GetEmbeddedDynamicDashboard. Retrieve the list of users and set them in a data structure to keep track of the images and user names. Code saample highlighted with yellow highlight

  7. Build a dictionary with a list of these RepeatArgs.

    Dictionary with a list of the RepeatArgs highlighted with yellow highlight

  8. Create the dashboard in memory and add that RepeatArgs, the list of objects containing the user images and user names, to this Tag object.

     RepeatArgs added to Tag object and higlighted with yellow highlight

  9. After the dashboard has built the list and ran the method, it calls the GetDynamicComponentsForDynamicDashboard method, which generates each individual object.

     GetDynamicComponentsForDynamicDashboard method displayed

This is the result. When this dashboard is run, it will display the corresponding user images and user names.

Design mode shows the Embedded Dynamic Repeater Dashboard has added multiple instances of the same components.